<?php
/**
 * Created by PhpStorm.
 * User: Aaron
 * Date: 2019/7/23
 * Time: 14:09
 */
namespace Inters\Model;

use Think\Model;

class MemberYhqModel extends Model
{
    /**
     * 可用优惠券总数
     */
    public function getCouponCount($id)
    {
        $nowTime = date('Y-m-d H:i:s', time());

        $map['member_id'] = array('eq', $id);
        $map['is_use'] = array('eq', 0);
        $map['end_time'] = array('gt', $nowTime);

        return $this->where($map)->count();
    }


    /**
     *  获取优惠卷
     */

    public function getCouponList($id)
    {





    }

}